package com.test.utils;

import com.test.enums.WX;

/**
 * getOppenid
 *
 * @author HY
 * 2021/05/17 14:11
 **/


public class GetOppenidUtil {

    public static String get(String js_code){
        String  oppenid = SendURL.sendGet("https://api.weixin.qq.com/sns/jscode2session",
                "appid=wx50886502b715d881" +
                        "&secret=122afbe553e269503d79db63a74f8725" +
                        "&js_code="+js_code+"" +
                        "&grant_type=authorization_code");

        WX wx = (WX) JsonUtil.getObject4JsonString(oppenid, WX.class);

        return wx.getOpenid();
    }
}
